<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/utilities/xajax/xajax_core/xajax.inc.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/gui/presenter/PresenterEmployee.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/FirePHPCore-0.3.2/lib/FirePHPCore/FirePHP.class.php';
		
	$debug = FirePHP :: getInstance(true);
	$debug -> setEnabled(true);
	
	//Permite eliminar los notices
	error_reporting (E_ALL ^ E_NOTICE);
	
	$_SESSION['debug'] = $debug;
	
	$xajax = new xajax(); 
	 
	$xajax -> register(XAJAX_FUNCTION, 'clickCreateEmployee');
	$xajax -> register(XAJAX_FUNCTION, 'loadExistingBranches');
	$xajax -> register(XAJAX_FUNCTION, 'updateDepartmentsList');
	 
	$xajax -> processRequest(); 
	 
	$xajax -> configure('javascript URI','../../../utilities/xajax/');
	
	function clickCreateEmployee($employeeForm) {
		$presenterEmployee = new PresenterEmployee();
		
		$employeeCreation = $presenterEmployee -> clickCreateEmployee($employeeForm);
		
		$response = new xajaxResponse();
		
		if ($employeeCreation == false)
			$response -> assign("transactionResult", "innerHTML", 
				'<font size="+1" color="#FF0000">La operaci&oacute;n fall&oacute;</font>');
		
		else
			$response -> assign("transactionResult", "innerHTML", 
				'<font size="+1" color="#006600">Operaci&oacute;n exitosa</font>');
		
		return $response;
	}
	
	/**
	 * Method to execute to load existing branches
	 */
	function loadExistingBranches() {
		$presenterEmployee = new PresenterEmployee();
		
		$branches = $presenterEmployee -> loadExistingBranches();
		
		$response = new xajaxResponse();
		
		$response -> assign("branch", "innerHTML", $branches);
		
		return $response;
	}
	
	/**
	 * Method to execute to load existing departments by branch rif
	 */
	function updateDepartmentsList($rif) {
		$presenterEmployee = new PresenterEmployee();
		
		$departments = $presenterEmployee -> updateDepartmentsList($rif);
		
		$response = new xajaxResponse();
		
		$response -> assign("department", "innerHTML", $departments);
		
		return $response;
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registre un nuevo empleado</title>
<?php 
	$xajax->printJavascript("../../../utilities/xajax/"); 
?>
<link rel="stylesheet" type="text/css" href="../css/formsStyles.css"/>
<link rel="stylesheet" type="text/css" href="../css/styles2.css" />

<!--Hoja de estilos del calendario -->
<link rel="stylesheet" type="text/css" media="all" href="../jscalendar/calendar-blue.css" title="win2k-cold-1" />

<!-- librería principal del calendario -->
<script type="text/javascript" src="../jscalendar/calendar.js"></script>

<!-- librería para cargar el lenguaje deseado -->
<script type="text/javascript" src="../jscalendar/lang/calendar-es.js"></script>

<!-- librería que declara la función Calendar.setup, que ayuda a generar un calendario en unas pocas líneas de código -->
<script type="text/javascript" src="../jscalendar/calendar-setup.js"></script>

<!-- include the Tools -->
<script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script> 
</head>
<body>
	<script>xajax_loadExistingBranches()</script>
	<div id="formsContainer">
        <div id="title">Registre un nuevo empleado</div><br />
        <div id="subtitle">Indique los datos personales del empleado</div>
        <form name="employeeForm" id="employeeForm">
            <table class="formTable" cellspacing="0" cellpadding="5">
               <tr class="odd">
                    <td align="right">C&eacute;dula de identidad</td>
                    <td align="left">
                    	<div id="ci">
                    		<input type="text" name="ci" size="32" maxlength="8" />
                        </div>
                    </td>
                    <td align="right">Primer nombre</td>
                    <td align="left">
                        <div id="firstName">
                        	<input type="text" name="firstName" size="32" maxlength="20" />
                        </div>
                    </td>
                </tr>
                
                <tr class="even">
                    <td align="right">Segundo nombre</td>
                    <td align="left">
                    	<div id="secondName">
                        	<input type="text" name="secondName" size="32" maxlength="20" />
                        </div>
                    </td>
                    <td align="right">Primer apellido</td>
                    <td align="left">
                    	<div id="firstLastName">
                        	<input type="text" name="firstLastName" size="32" maxlength="20" />
                        </div>
                    </td>
                </tr>
                
                <tr class="odd">
                    <td align="right">Segundo apellido</td>
                    <td align="left">
                    	<div id="secondLastName">
                           <input type="text" name="secondLastName" size="32" maxlength="20" />
                        </div>
                    </td>
                    <td align="right">Correo electr&oacute;nico</td>
                    <td align="left">
                        <input type="text" name="emailAddress" size="32" maxlength="40" />
                    </td>
                </tr>
                
                <tr class="even">
                    <td align="right" valign="top">Direcci&oacute;n</td>
                    <td align="left">
                    	<div id="address">
                        	<textarea name="address" cols="21" rows="5" readonly="readonly"
                        		class="modalInput" rel="#promptAddress">Click aqu&iacute; para ingresar la direcci&oacute;n...</textarea>
                        </div>
                    </td>
                     <td align="right" valign="top">Tel&eacute;fonos</td>
                    <td align="left">
                        <textarea name="phones" cols="21" rows="5" readonly="readonly"
                        	class="modalInput" rel="#promptPhones">Click aqu&iacute; para ingresar los tel&eacute;fonos...</textarea>
                    </td>
                </tr>
       		</table>
        
        	<br /><div id="subtitle">Indique los datos corporativos del empleado</div>
        	<table class="formTable" cellspacing="0" cellpadding="5">
                <tr class="odd">
                    <td align="right">Fecha de ingreso</td>
                    <td align="left">                    	
                        <input type="text" id="employeeStartDate" name="employeeStartDate" 
                            readonly="readonly" size="25" />&nbsp;
                        <input type="button" id="employeeStartDateLauncher" value="..." />                    </td>
                    <td align="right">Fecha de egreso</td>
                    <td align="left">                    	
                        <input type="text" id="employeeEndDate" name="employeeEndDate" 
                            readonly="readonly" size="25" />&nbsp;
                        <input type="button" id="employeeEndDateLauncher" value="..." />                    </td>
                </tr>
                
                <tr class="even">
                    <td align="right">Cargo</td>
                    <td align="left">
                    	<div id="job">
                        	<input type="text" name="job" size="32" maxlength="30" />
                        </div>
                    </td>
                    <td align="right">Salario</td>
                    <td align="left">
                    	<div id="salary">
                        	<input type="text" name="salary" size="32" maxlength="15" />
                        </div>
                    </td>
                </tr>
                
                <tr class="odd">
                    <td align="right">Sucursal</td>
                    <td align="left">
                    	<div id="branch">
                            <select name="branch">
                                <option value="0">Seleccione una sucursal</option>
                            </select>
                        </div>
                    </td>
                    <td align="right">Departamento</td>
                    <td align="left">
                    	<div id="department">
                            <select name="department">
                                <option value="0">Seleccione un departamento</option>
                            </select>
                        </div>
                    </td>
                </tr>
            </table>
            
            <div id="transactionResult" align="center"></div>
            
            <br /><div id="buttons" align="center">
            	<input type="button" name="buttonCreateEmployee" value="Registrar" onclick="xajax_clickCreateEmployee(xajax.getFormValues('employeeForm'))" />
            </div>
     	</form>
    </div>
    
    <!-------------------- PROMPTS -------------------->
    
    <div class="modal" id="promptAddress">
        <form id="clientAddress" name="clientAddress">
            <div align="center"><h2>Ingrese la direcci&oacute;n del cliente</h2></div>
            <table class="formTable" cellspacing="0" cellpadding="5">
                <tr class="odd">
                    <td align="right">Pa&iacute;s</td>
                    <td align="left">
                        <select id="country" class="country">
                        
                        	<option value="0">SELECCIONE UN PA&Iacute;S</option>
                        
                            <option value="AF">AFGHANISTAN</option>
                            <option value="AL">ALBANIA</option>
                            <option value="DE">ALEMANIA</option>
                            <option value="**">ALTA MAR: AGUAS INTERNACIONALES</option>
                            <option value="AV">ALTO VOLTA</option>
                            <option value="AD">ANDORRA</option>
                            
                            <option value="AO">ANGOLA</option>
                            <option value="IA">ANGUILLA</option>
                            <option value="AI">ANGUILLA</option>
                            <option value="AQ">ANTÁRTIDA</option>
                            <option value="AG">ANTIGUA Y BARBUDA</option>
                            <option value="AN">ANTILLAS HOLANDESAS</option>
                            <option value="SA">ARABIA SAUDI</option>
                            <option value="DZ">ARGELIA</option>
                            <option value="AR">ARGENTINA</option>
                            
                            <option value="AM">ARMENIA</option>
                            <option value="AW">ARUBA</option>
                            <option value="AU">AUSTRALIA</option>
                            <option value="AT">AUSTRIA</option>
                            <option value="AZ">AZERBAIJAN</option>
                            <option value="BS">BAHAMAS</option>
                            <option value="BH">BAHRAIN</option>
                            <option value="BD">BANGLADES</option>
                            <option value="BB">BARBADOS</option>
                            
                            <option value="BY">BELARUS</option>
                            <option value="BE">BELGICA</option>
                            <option value="BZ">BELIZE</option>
                            <option value="BJ">BENIN</option>
                            <option value="BM">BERMUDA</option>
                            <option value="*4">BIRMANIA</option>
                            <option value="BO">BOLIVIA</option>
                            <option value="BA">BOSNIA HERCEGOVINA</option>
                            <option value="BW">BOSTWANA</option>
                            
                            <option value="BR">BRASIL</option>
                            <option value="BN">BRUNEI DARUSALAM</option>
                            <option value="BG">BULGARIA</option>
                            <option value="BF">BURKINA FASO</option>
                            <option value="BU">BURMA</option>
                            <option value="BI">BURUNDI</option>
                            <option value="BT">BUTAN</option>
                            <option value="CV">CABO VERDE</option>
                            <option value="KH">CAMBOYA</option>
                            
                            <option value="CM">CAMERUN</option>
                            <option value="CA">CANADA</option>
                            <option value="TD">CHAD</option>
                            <option value="CL">CHILE</option>
                            <option value="CN">CHINA</option>
                            <option value="CY">CHIPRE</option>
                            <option value="VA">CIUDAD DEL VATICANO</option>
                            <option value="CO">COLOMBIA</option>
                            <option value="KM">COMOROS</option>
                            
                            <option value="CG">CONGO</option>
                            <option value="CR">COSTA RICA</option>
                            <option value="CI">COTE D`IVOIRE</option>
                            <option value="HR">CROACIA</option>
                            <option value="CU">CUBA</option>
                            <option value="99">DESCONOCIDO</option>
                            <option value="DK">DINAMARCA</option>
                            <option value="DM">DOMINICA</option>
                            <option value="EC">ECUADOR</option>
                            
                            <option value="EG">EGIPTO</option>
                            <option value="SV">EL SALVADOR</option>
                            <option value="AE">EMIRATOS ARABES UNIDOS</option>
                            <option value="ER">ERITREA</option>
                            <option value="SK">ESLOVAQUIA</option>
                            <option value="SI">ESLOVENIA</option>
                            <option value="ES">ESPAÑA</option>
                            <option value="US">ESTADOS UNIDOS</option>
                            <option value="EE">ESTONIA</option>
                            
                            <option value="ET">ETIOPIA</option>
                            <option value="CS">(EXTINTA) CHECOSLOVAQUIA</option>
                            <option value="SU">(EXTINTA) URSS</option>
                            <option value="FM">FEDERACION DE ESTADOS DE MICRONESIA</option>
                            <option value="RU">FEDERACION RUSA</option>
                            <option value="FJ">FIJI</option>
                            <option value="PH">FILIPINAS</option>
                            <option value="FI">FINLANDIA</option>
                            <option value="FR">FRANCIA</option>
                            
                            <option value="GA">GABON</option>
                            <option value="GM">GAMBIA</option>
                            <option value="GH">GANA</option>
                            <option value="ZZ">GENERICO (NO U.E.)</option>
                            <option value="XX">GENERICO (U.E.)</option>
                            <option value="GE">GEORGIA</option>
                            <option value="GI">GIBRALTAR</option>
                            <option value="GD">GRANADA</option>
                            <option value="GR">GRECIA</option>
                            
                            <option value="GL">GROENLANDIA</option>
                            <option value="GP">GUADALUPE</option>
                            <option value="GU">GUAM</option>
                            <option value="GT">GUATEMALA</option>
                            <option value="GF">GUAYANA FRANCESA</option>
                            <option value="GG">GUERNSEY</option>
                            <option value="GN">GUINEA</option>
                            <option value="GW">GUINEA BISSAU</option>
                            <option value="GQ">GUINEA ECUATORIAL</option>
                            
                            <option value="GY">GUYANA</option>
                            <option value="HT">HAITI</option>
                            <option value="HN">HONDURAS</option>
                            <option value="HK">HONG KONG</option>
                            <option value="HU">HUNGRIA</option>
                            <option value="IN">INDIA</option>
                            <option value="*2">INDIAS OCCIDENTALES</option>
                            <option value="ID">INDONESIA</option>
                            <option value="XZ">INSTALACIONES EN AGUA INTERNACIONAL</option>
                            
                            <option value="IQ">IRAK</option>
                            <option value="IE">IRLANDA</option>
                            <option value="IM">ISLA DE MAN</option>
                            <option value="IS">ISLANDIA</option>
                            <option value="FK">ISLAS  FALKLAND (MALVINAS)</option>
                            <option value="KY">ISLAS CAIMAN</option>
                            <option value="CX">ISLAS CHRISTMAS</option>
                            <option value="CC">ISLAS COCOS (KEELING)</option>
                            <option value="CK">ISLAS COOK</option>
                            
                            <option value="FO">ISLAS FAROE</option>
                            <option value="GS">ISLAS GEORGIAS Y SANDWICH DEL SUR</option>
                            <option value="HM">ISLAS HEARD Y MACDONALD</option>
                            <option value="MP">ISLAS MARIANAS</option>
                            <option value="MH">ISLAS MARSHALL</option>
                            <option value="NF">ISLAS NORFOLK</option>
                            <option value="*7">ISLAS PEITCARN</option>
                            <option value="PN">ISLAS PITCAIRN</option>
                            <option value="SB">ISLAS SALOMON</option>
                            
                            <option value="TC">ISLAS TURKS Y CAICOS</option>
                            <option value="VG">ISLAS VIRGENES BRITANICAS</option>
                            <option value="VI">ISLAS VIRGENES (ESTADO UNIDOS)</option>
                            <option value="WF">ISLAS WALLIS Y FUTUA</option>
                            <option value="IL">ISRAEL</option>
                            <option value="IT">ITALIA</option>
                            <option value="JK">JAMAICA</option>
                            <option value="JM">JAMAICA</option>
                            <option value="JP">JAPON</option>
                            
                            <option value="JE">JERSEY</option>
                            <option value="DJ">JIBUTI</option>
                            <option value="JO">JORDANIA</option>
                            <option value="KZ">KAZAKHSTAN</option>
                            <option value="KE">KENIA</option>
                            <option value="KI">KIRIBATI</option>
                            <option value="XK">KOSOVO</option>
                            <option value="KW">KUWAIT</option>
                            <option value="KG">KYRGYZSTAN</option>
                            
                            <option value="LS">LESOTO</option>
                            <option value="LV">LETONIA</option>
                            <option value="LB">LIBANO</option>
                            <option value="LR">LIBERIA</option>
                            <option value="LY">LIBIA</option>
                            <option value="LI">LIECHTENSTEIN</option>
                            <option value="LT">LITUANIA</option>
                            <option value="LU">LUXEMBURGO</option>
                            <option value="MO">MACAO</option>
                            
                            <option value="MG">MADASGASCAR</option>
                            <option value="MY">MALASIA</option>
                            <option value="MW">MALAWI</option>
                            <option value="MV">MALDIVAS</option>
                            <option value="ML">MALI</option>
                            <option value="MT">MALTA</option>
                            <option value="MA">MARRUECOS</option>
                            <option value="MQ">MARTINICA</option>
                            <option value="MU">MAURICIO</option>
                            
                            <option value="MR">MAURITANIA</option>
                            <option value="*3">MAYOTTE</option>
                            <option value="YT">MAYOTTE</option>
                            <option value="MX">MEJICO</option>
                            <option value="MD">MOLDAVIA</option>
                            <option value="MC">MONACO</option>
                            <option value="MN">MONGOLIA</option>
                            <option value="MS">MONSERRAT</option>
                            <option value="ME">MONTENEGRO</option>
                            
                            <option value="MZ">MOZAMBIQUE</option>
                            <option value="MM">MYANMAR (BURMA)</option>
                            <option value="NA">NAMIBIA</option>
                            <option value="NR">NAURU</option>
                            <option value="NP">NEPAL</option>
                            <option value="NI">NICARAGUA</option>
                            <option value="NE">NIGER</option>
                            <option value="NG">NIGERIA</option>
                            <option value="NU">NIUE</option>
                            
                            <option value="NO">NORUEGA</option>
                            <option value="NC">NUEVA CALEDONIA</option>
                            <option value="NZ">NUEVA ZELANDA</option>
                            <option value="*6">OCEANIA AMERICANA</option>
                            <option value="*5">OCEANIA AUSTRALIANA</option>
                            <option value="*8">OCEANIA NEOZELANDESA</option>
                            <option value="OM">OMAN</option>
                            <option value="NL">PAÍSES BAJOS</option>
                            <option value="PK">PAKISTAN</option>
                            
                            <option value="PW">PALAU</option>
                            <option value="PA">PANAMA</option>
                            <option value="PG">PAPUA NUEVA GUINEA</option>
                            <option value="PY">PARAGUAY</option>
                            <option value="PE">PERU</option>
                            <option value="PF">POLINESIA FRANCESA</option>
                            <option value="PL">POLONIA</option>
                            <option value="PT">PORTUGAL</option>
                            <option value="PR">PUERTO RICO</option>
                            
                            <option value="QA">QATAR</option>
                            <option value="*9">REGIONES POLARES</option>
                            <option value="GB">REINO UNIDO</option>
                            <option value="CF">REPUBLICA CENTRO AFRICANA</option>
                            <option value="CZ">REPUBLICA CHECA</option>
                            <option value="KR">REPUBLICA DE KOREA</option>
                            <option value="MK">REPUBLICA DE MACEDONIA</option>
                            <option value="KP">REPUBLICA DEMOCRATICA DE KOREA</option>
                            <option value="LA">REPUBLICA DEMOCRATICA DE LAOS</option>
                            
                            <option value="DO">REPUBLICA DOMINICANA</option>
                            <option value="FE">REPUBLICA FEDERAL ALEMANA</option>
                            <option value="IR">REPUBLICA ISLAMICA DE IRAN</option>
                            <option value="RE">REUNION</option>
                            <option value="RW">RUANDA</option>
                            <option value="RO">RUMANIA</option>
                            <option value="EH">SAHARA OCCIDENTAL</option>
                            <option value="WS">SAMOA</option>
                            <option value="AS">SAMOA AMERICANA</option>
                            
                            <option value="SM">SAN MARINO</option>
                            <option value="PM">SAN PIERRE Y MIQUELOSDN</option>
                            <option value="VC">SAN VICENTE Y GRANADINAS</option>
                            <option value="SH">SANTA HELENA</option>
                            <option value="KN">SANTA KITTS-NEVIS</option>
                            <option value="LC">SANTA LUCIA</option>
                            <option value="ST">SANTO TOME Y PUERTO PRINCIPE</option>
                            <option value="SN">SENEGAL</option>
                            <option value="XS">SERBIA</option>
                            
                            <option value="RS">SERBIA</option>
                            <option value="SC">SEYCHELES</option>
                            <option value="SL">SIERRA LEONA</option>
                            <option value="SG">SINGAPUR</option>
                            <option value="SY">SIRIA</option>
                            <option value="SO">SOMALIA</option>
                            <option value="LK">SRI LANKA</option>
                            <option value="ZA">SUDAFRICA</option>
                            <option value="SD">SUDAN</option>
                            
                            <option value="SE">SUECIA</option>
                            <option value="CH">SUIZA</option>
                            <option value="SR">SURANIME</option>
                            <option value="SJ">SVALBARD Y JAN MAYEN</option>
                            <option value="SZ">SWAZILANDIA</option>
                            <option value="TH">TAILANDIA</option>
                            <option value="TW">TAIWAN</option>
                            <option value="TJ">TAJIKISTAN</option>
                            <option value="TZ">TANZANIA</option>
                            
                            <option value="IO">TERRIT. BRITÁNICO DEL OCÉANO ÍNDICO</option>
                            <option value="TF">TERRITORIOS AUSTRALES FRANCESES</option>
                            <option value="*1">TERRITORIOS BRITANICOS OCEANO</option>
                            <option value="CD">THE DEMOCRATIC REPUBLIC OF CONGO</option>
                            <option value="TP">TIMOR (ESTE)</option>
                            <option value="TL">TIMOR-LESTE</option>
                            <option value="TG">TOGO</option>
                            <option value="TK">TOKELAU</option>
                            <option value="TO">TONGA</option>
                            
                            <option value="TT">TRINIDAD Y TOBAGO</option>
                            <option value="TN">TUNICIA</option>
                            <option value="TM">TURKMENISTAN</option>
                            <option value="TR">TURQUIA</option>
                            <option value="TV">TUVALU</option>
                            <option value="UA">UCRANIA</option>
                            <option value="UG">UGANDA</option>
                            <option value="UY">URUGUAY</option>
                            <option value="UM">US MINOR OUTLYNG ISLANDS</option>
                            
                            <option value="UZ">UZBEKISTAN</option>
                            <option value="VU">VANUATU</option>
                            <option value="VE">VENEZUELA</option>
                            <option value="VN">VIET NAM</option>
                            <option value="YE">YEMEN</option>
                            <option value="YU">YUGOSLAVIA</option>
                            <option value="ZR">ZAIRE</option>
                            <option value="ZM">ZAMBIA</option>
                            <option value="ZW">ZIMBABWE</option>
                            
                        </select>
                    </td>
                </tr>
                
                <tr class="even">
                	<td align="right">Estado/Provincia</td>
                    <td align="left">
                    	<select id="stateProvince" class="stateProvince">
                        	<option value="0">SELECCIONE UN ESTADO/PROVINCIA</option>
                            <option value="1">MIRANDA</option>
                        </select>
                    </td>
                </tr>
                
                <tr class="odd">
                	<td align="right">Ciudad</td>
                    <td align="left">
                    	<select id="city" class="city">
                        	<option value="0">SELECCIONE UNA CIUDAD</option>
                            <option value="1">CARACAS</option>
                        </select>
                    </td>
                </tr>
                
                <tr class="even">
                	<td align="right" valign="top">Sector</td>
                    <td align="left">
                    	<textarea id="zone" cols="35" rows="5"></textarea>
                    </td>
                </tr>
            </table>
            
            <div id="buttons" align="center"><button type="submit">Aceptar</button></div>
            
      	</form>
    </div>
    
    <div class="modal" id="promptPhones">
    	<form id="clientPhones" name="clientPhones">
        	<div align="center">
            	<h2>Ingrese los tel&eacute;fonos del cliente</h2>
            </div>
            <table class="formTable" cellspacing="0" cellpadding="5">
                <tr class="odd">
                    <td align="right">Habitaci&oacute;n</td>
                    <td align="center">
                    	<input type="text" id="homeSerial" size="5" maxlength="5" />
                    </td>
                    <td align="left">
                    	<input type="text" id="homeNumber" size="10" maxlength="10" />
                    </td>
                </tr>
                
                <tr class="even">
                    <td align="right">M&oacute;vil</td>
                    <td align="center">
                    	<input type="text" id="mobileSerial" size="5" maxlength="5" />
                    </td>
                    <td align="left">
                    	<input type="text" id="mobileNumber" size="10" maxlength="10" />
                    </td>
                </tr>
                
                <tr class="odd">
                    <td align="right">Trabajo</td>
                    <td align="center">
                    	<input type="text" id="workSerial" size="5" maxlength="5" />
                    </td>
                    <td align="left">
                    	<input type="text" id="workNumber" size="10" maxlength="10" />
                    </td>
                </tr>
                
                <tr class="even">
                    <td align="right">Fax</td>
                    <td align="center">
                    	<input type="text" id="faxSerial" size="5" maxlength="5" />
                    </td>
                    <td align="left">
                    	<input type="text" id="faxNumber" size="10" maxlength="10" />
                    </td>
                </tr>
            </table>
            
            <div id="buttons" align="center"><button type="submit">Aceptar</button></div>
        </form>
    </div>
    
    <script>
		$(document).ready(function() {
		
			var triggers = $(".modalInput").overlay({
			
				// some mask tweaks suitable for modal dialogs
				mask: {
					color: '#ebecff',
					loadSpeed: 200,
					opacity: 0.9
				},
			
				closeOnClick: false
			});
			
			
			$("#promptAddress form").submit(function(e) {
			
				// close the overlay
				triggers.eq(0).overlay().close();
			
				// get user input
				var country = $("#country option:selected").text();
				var stateProvince = $("#stateProvince option:selected").text();
				var city = $("#city option:selected").text();
				var zone = $("textarea", this).val();
				
				// concat values
				var address = zone + ', ' + city + ', ' + stateProvince + ', ' + country;
			
				// do something with the answer
				triggers.eq(0).html(address);
			
				// do not submit the form
				return e.preventDefault();
			});
			
			$("#promptPhones form").submit(function(e) {
			
				// close the overlay
				triggers.eq(1).overlay().close();
			
				// get user input
				var homeSerial = $("#homeSerial", this).val();
				var homeNumber = $("#homeNumber", this).val();
				var mobileSerial = $("#mobileSerial", this).val();
				var mobileNumber = $("#mobileNumber", this).val();
				var workSerial = $("#workSerial", this).val();
				var workNumber = $("#workNumber", this).val();
				var faxSerial = $("#faxSerial", this).val();
				var faxNumber = $("#faxNumber", this).val();
				
				// concat values
				var phones = 'Habitaci&oacute;n: ' + homeSerial + '.' + homeNumber + '\n' + 
					'M&oacute;vil: ' + mobileSerial + '.' + mobileNumber + '\n' + 
					'Trabajo: ' + workSerial + '.' + workNumber + '\n' + 
					'Fax: ' + faxSerial + '.' + faxNumber;
			
				// do something with the answer
				triggers.eq(1).html(phones);
			
				// do not submit the form
				return e.preventDefault();
			});
		});
	
	</script>
    
    <!-- script que define y configura el calendario-->
    <script type="text/javascript">
    	Calendar.setup({
			inputField:"employeeStartDate",
			ifFormat:"%Y-%m-%d",
			button:"employeeStartDateLauncher"
		});
		
		Calendar.setup({
			inputField:"employeeEndDate",
			ifFormat:"%Y-%m-%d",
			button:"employeeEndDateLauncher"
		});
    </script> 
</body>
</html>